// import data from '../data/data.json'
// export const getWord = () => {
//     let index = localStorage.getItem('juzi') ? Number(localStorage.getItem('juzi')) : -1
//     const d = data[index + 1]
//     if (d) {
//         localStorage.setItem('juzi', index + 1)
//         return d
//     } else {
//         localStorage.setItem('juzi', 0)
//         return data[0]
//     }
// }

export const getCurWord = async () => {
    const rs = await fetch('./db/' + (new Date()).toLocaleDateString().replaceAll('/', '-') + '.json')
        .then((res) => { return res.json(); })
// console.log(rs)
    return rs
}

export const getLocalWord =  () => {
    
    return localStorage.getItem('word') || '默认内容'
}